package com.example.transactionaltest.controller;

import com.example.transactionaltest.service.TestService1;
import com.example.transactionaltest.service.TestService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zbc
 * @description
 * @email
 * @date 2021/1/6 16:03
 */
@RestController
public class TestController {

    @Autowired
    private TestService1 testService1;

    @Autowired
    private TestService2 testService2;

    @RequestMapping("/test")
//    @Transactional
    public String test(){
        System.out.println("test");
        testService1.insert();
        testService2.insert();
        return "test";
    }
}
